<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>

		<button type="button" id="btn">本周</button>
		<div id="box">时间：</div>
		<script>
			btn.onclick = function() {
				var box = document.getElementById("box")
				var dt = new Date();
				var yyyy = dt.getFullYear();
				var mm = dt.getMonth();
				var dd = dt.getDate();
				var week = dt.getDay(); //0-6

				var rs = getWeekStartDate() + "-" + getWeekEndDate();
				box.innerHTML = rs;

				//获得本周的开始日期 
				function getWeekStartDate() {
					var weekStartDate = new Date(yyyy, mm, dd - week + 1);
					var m = weekStartDate.getFullYear()
					return formatDate(weekStartDate);
				}
				//获得本周的开始日期 
				function getWeekEndDate() {
					var weekEndDate = new Date(yyyy, mm, dd + 7 - week);
					return formatDate(weekEndDate);
				}
			}
 
			function formatDate(_dt) {
				var _yyyy = _dt.getFullYear();
				var _mm = _dt.getMonth() + 1;
				var _dd = _dt.getDate();
				if(_mm < 10) {
					_mm = "0" + _mm;
				}
				if(_dd < 10) {
					_dd = "0" + _dd;
				}
				
				//return(_yyyy + "-" + _mm + "-" + _dd);
				return(  _mm + "/" + _dd);
			}
			
		var dtx = {
			 dt:function(dt){
			 	dt = new Date();
			 },
			 yyyy:this.dt.getFullYear();
			 mm:this.dt.getMonth();
	 		dd:this.dt.getDate();
			week:this.dt.getDay(); //0-6
		}
		</script>
	</body>

</html>